<?php

namespace app\home\model;

use think\Model;

class User extends Model
{
    //    链表
    protected $table = 'user';

//登录
    public static function login($where)
    {
        return self::where(function ($query) use ($where) {
            $query->whereOr('email', $where['username']);
            $query->whereOr('username', $where['username']);
            $query->whereOr('phone', $where['username']);
        })->where('password', md5($where['password']))->find();
    }
}
